﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using NWN.GDY.Service.Entity;

namespace NWN.GDY.Web.uc
{
    public partial class ucTableSeat : System.Web.UI.UserControl
    {
        public Seat UserSeat { set; get; }
        public bool IsCreator { set; get; }
        public string TableGUID { set; get; }
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        public void BindInfo()
        {
            pnlUser.Visible = false;
            pnlCreator.Visible = false;
            if (UserSeat.OccupiedPlayer != null)
            {
                lblUserName.Text = UserSeat.OccupiedPlayer.NickName;
                pnlUser.Visible = true;
                if (UserSeat.OccupiedPlayer.UID == Session.SessionID)
                {
                    plhCurrentUser.Visible = true;
                }
            }
            else if (IsCreator)
            {
                pnlCreator.Visible = true;
                if (UserSeat.Disabled)
                {
                    //lblStatus.Text = "禁用";
                }
                else
                {
                    //lblStatus.Text = "可用";
                }
            }
        }
    }
}